package com.lc.yunanxin.widget


import android.content.Context
import android.util.AttributeSet
import com.hinnotek.amoeba.R
import com.qmuiteam.qmui.layout.QMUIFrameLayout
import com.qmuiteam.qmui.util.QMUIDisplayHelper

/**
 * desripbe ShadowFrameLayout
 */
class ShadowFrameLayout : QMUIFrameLayout {
    constructor(context: Context?) : super(context) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {

        val typedArray = context!!.obtainStyledAttributes(attrs, R.styleable.ShadowFrameLayout)
        val mRadius = typedArray.getInt(R.styleable.ShadowFrameLayout_myShadowRadius, 5)
        typedArray.recycle()
        val mShadowElevation =  QMUIDisplayHelper.dp2px(context, 5)
        setRadiusAndShadow(QMUIDisplayHelper.dp2px(context, mRadius),mShadowElevation,255.0f/3.0f)

        shadowColor = 0xFFDAE6EF.toInt()
    }

    constructor(
            context: Context?,
            attrs: AttributeSet?,
            defStyleAttr: Int
    ) : super(context, attrs, defStyleAttr) {


    }

    /* private fun change() {
         val mRadius = QMUIDisplayHelper.dp2px(context, 6)
         val mShadowElevation =  QMUIDisplayHelper.dp2px(context, 3)
         setRadiusAndShadow(mRadius,mShadowElevation,255.0f/2)
         shadowColor = 0xFFDAE6EF.toInt()
     }*/
}